package study;

import java.util.Arrays;

public class TestSubstring {
    public static void main (String[] args){
        String sb="com.abcd.1234";
        String sb1,sb2,sb3;
        sb1=sb.substring(0,sb.indexOf("."));
        sb2=sb.substring(sb.indexOf("."),sb.lastIndexOf("."));
        sb3=sb.substring(sb.lastIndexOf("."));
        String[] sb4=sb.split(".");
        System.out.println(sb1);
        System.out.println(sb2);
        System.out.println(sb3);
        System.out.println(Arrays.toString(sb4));
    }
}
